package pattern.composite;

import java.util.Iterator;

public class Selector {
	private FileComponent root;
	
	public Selector(FileComponent root){
		this.root = root;
	}
	
	public void print(){
		root.print();
	}
	
	public void printAVI(){
		Iterator<FileComponent> it = root.createIterator();
		while(it.hasNext()){
			FileComponent fc = it.next();
//			if("AVI".equals(fc.getFileType())){
				System.out.println(fc.getName() + "." + fc.getFileType());
//			}
		}
	}
}
